CC = g++
CPPFLAGS = -Iinclude -Ilib/minIni -std=gnu++11
LDFLAGS  = -lSDL2 -lSDL2_image

CPPFILES  = src/antelope.cpp src/entitymanager.cpp src/inputhandler.cpp $(CPPFILES2)
CPPFILES2 = src/main.cpp src/resources.cpp src/blitqueue.cpp src/human.cpp	$(CPPFILES3)
CPPFILES3 = src/gaiacontroller.cpp src/map.cpp src/spriteanimator.cpp	$(CPPFILES4)
CPPFILES4 = src/config.cpp src/game.cpp src/oribi.cpp src/sprite.cpp		$(CPPFILES5)
CPPFILES5 = src/entityaction.cpp src/grcontext.cpp src/player.cpp		$(CPPFILES6)
CPPFILES6 = src/stdcharanim.cpp src/entity.cpp src/projection.cpp

OBJFILES = $(addprefix obj/, $(notdir $(CPPFILES:.cpp=.o))) obj/minIni.o

EXEC = oribi

all = minIni $(OBJFILES) $(EXEC)

$(EXEC) : $(OBJFILES)
	$(CC) $(CPPFLAGS) $(OBJFILES) -o $@ $(LDFLAGS)

.cpp.o:
	$(CC) -c $(CPPFLAGS) $< -o $@
	mv $@ obj

obj/minIni.o :
	gcc -c lib/minIni/minIni.c -o obj/minIni.o

debug :
	make "CPPFLAGS=$(CPPFLAGS) -ggdb -DDEBUG"
	
clean :
	rm $(OBJFILES) $(EXEC)
